package com.bprogram.controller;

import com.bprogram.pojo.Video;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
@FeignClient(value = "VIDEO")
public interface VideoFeign {
    @GetMapping("/video/getAll")
    public List<Video> getAllVideo();

    @GetMapping("/video/getVideo")
    public Video getVideo(@RequestParam("id") long id);

    /**
     * 根据UpId获取到他所有视频的总点赞数
     * @param upId
     * @return
     */
    @GetMapping("/video/getTotalLikeByUpId")
    public String getTotalLikeByUpId(@RequestParam("upId") long upId);

    /**
     * 根据UpId获取到他所有视频的总播放数
     * @param upId
     * @return
     */
    @GetMapping("/video/getTotalPlayTimesByUpId")
    public String getTotalPlayTimesByUpId(@RequestParam("upId") long upId);

    /**
     * 根据UpId获取到他所有视频的总投稿数
     * @param upId
     * @return
     */
    @GetMapping("/video/getTotalUploadByUpId")
    public String getTotalUploadByUpId(@RequestParam("upId") long upId);





    @PostMapping("/video/saveOrUpdateVideo")
    public Video saveOrUpdate(@RequestBody Video video);

}
